package com.dzsw.javabase.str;

public class PrintSQL {

    public static void main(String[] args) {
        int num = 20;
        printInsertSQL("oracle_", num);
        System.out.println("----------------------------------------------------------------");
        printInsertSQL("sql_any_where_", num);
        System.out.println("----------------------------------------------------------------");
        printInsertSQL("mssql_server_", num);
    }

    private static void printInsertSQL(String sign, int num) {
        String sql = "INSERT INTO users(user_id, user_name, user_level) VALUES(%s, '%s', %s);";
        for (int i = 0; i < num; i++) {
            String str = String.format(sql, i + 1, sign + (i + 1), (i + 1) % 5);
            System.out.println(str);
        }
    }
}
